Skip to content

Conversation

matiasinsaurralde
Copy link

OpenFHE provides macOS support.

After building OpenFHE on macOS I've noticed that current main branch doesn't build on macOS:

% go test . -tags 'openfhe'                                               
# github.com/collapsinghierarchy/openfhe-go.test
ld: warning: ignoring duplicate libraries: '-lc++'
dyld[48543]: Library not loaded: @rpath/libOPENFHEcore.1.dylib
  Referenced from: <A2C383E2-3C60-3420-FB90-F4D5EFC96691> /private/var/folders/s5/3_m33khx5njfpz_5g1d4wrkc0000gn/T/go-build1261414508/b001/openfhe-go.test
  Reason: no LC_RPATH's found
signal: abort trap
FAIL	github.com/collapsinghierarchy/openfhe-go	0.310s
FAIL

The change adds -Wl,-rpath,/usr/local/lib to macOS (darwin) linker flags, macOS 10.5 and above use/expect rpath for search path:

% go test . -tags 'openfhe'
# github.com/collapsinghierarchy/openfhe-go.test
ld: warning: ignoring duplicate libraries: '-lc++'
ok  	github.com/collapsinghierarchy/openfhe-go	0.328s

The introduction of these linker flags enable macOS support for openfhe-go and the usage of the darwin build tag will ensure they're only used for macOS builds 👍

Signed-off-by: Matías Insaurralde <matias@insaurral.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant